.border modifier adds Border to a View.
Syntax
.border(Color.red, width: 2.0)
Example
struct ContentView: View {
var body: some View {
Text("This is some Text that I have entered. \n Second line increase Height.")
.border(Color.red, width: 2)
}
}
Output